import 'package:guochaoapp/model/telephone_entity.dart';

telephoneEntityFromJson(TelephoneEntity data, Map<String, dynamic> json) {
	if (json['success'] != null) {
		data.success = json['success'];
	}
	if (json['msg'] != null) {
		data.msg = json['msg'].toString();
	}
	if (json['code'] != null) {
		data.code = json['code'] is String
				? int.tryParse(json['code'])
				: json['code'].toInt();
	}
	if (json['data'] != null) {
		data.data = new TelephoneData().fromJson(json['data']);
	}
	if (json['sign'] != null) {
		data.sign = json['sign'];
	}
	return data;
}

Map<String, dynamic> telephoneEntityToJson(TelephoneEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['success'] = entity.success;
	data['msg'] = entity.msg;
	data['code'] = entity.code;
	if (entity.data != null) {
		data['data'] = entity.data.toJson();
	}
	data['sign'] = entity.sign;
	return data;
}

telephoneDataFromJson(TelephoneData data, Map<String, dynamic> json) {
	if (json['telephone'] != null) {
		data.telephone = json['telephone'].toString();
	}
	return data;
}

Map<String, dynamic> telephoneDataToJson(TelephoneData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['telephone'] = entity.telephone;
	return data;
}